package com.benz.order.util.multithread;

public class JoinThreadTest {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new JoinThread(),"Thread 1");
        t1.start();
        for (int i = 0; i < 6; i++) {
            System.out.println(Thread.currentThread().getName()+"输出：------"+i);
            if(i==2){
                t1.join();
            }
            Thread.sleep(500);
        }
    }
}
